package cn.bluemobi.app.controller.detail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.bluemobi.app.core.controller.AppBaseController;
import cn.bluemobi.app.entity.output.BusinessRewardDetail;
import cn.bluemobi.app.entity.output.PointsDetail;
import cn.bluemobi.app.service.DetailService;
import cn.bluemobi.common.core.dto.Page;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;

/**
 * 
 * @author lvxh
 * 
 */
@Controller
@RequestMapping("/detail")
@Api(description = "明细", value = "detail")
public class DetailController extends AppBaseController {

	@Autowired
	private DetailService detailService;

	@ApiOperation(value = "查询会员积分明细列表", httpMethod = "POST")
	@RequestMapping("/findPointsDetailList")
	@ResponseBody
	public Page<PointsDetail> findPointsDetailList(
			@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
			@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize,
			@ApiParam("会员ID") @RequestParam(value = "memberId", required = false) String memberId) {
		return detailService.findPointsDetailList(pageNo, pageSize, memberId);
	}

	@ApiOperation(value = "查询商家会员奖励明细列表", httpMethod = "POST")
	@RequestMapping("/findBusinessRewardDetailList")
	@ResponseBody
	public Page<BusinessRewardDetail> findBusinessRewardDetailList(
			@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
			@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize,
			@ApiParam("会员ID") @RequestParam(value = "memberId", required = false) String memberId) {
		return detailService.findBusinessRewardDetailList(pageNo, pageSize,
				memberId);
	}
}
